package inet.app.view.dialog;

import inet.app.R;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.EditText;
import android.widget.TextView;

public class NewPassDialog extends DialogFragment {

	private EditText mNewpassEdt;
	private EditText mRenewPassEdt;
	private TextView mErrorText;

	private Context mContext;
	private String mNewPass;
	private String mRenewPass;

	public NewPassDialog(Context context) {
		this.mContext = context;
	}

	public static NewPassDialog newInstance(Context context) {
		NewPassDialog newPassDialog = new NewPassDialog(context);
		return newPassDialog;
	}

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		Dialog dialog = new Dialog(mContext, android.R.style.Theme_Dialog);
		dialog.setCanceledOnTouchOutside(false);
		dialog.setCancelable(false);
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

		View view = LayoutInflater.from(mContext).inflate(R.layout.view_new_password,
				null);

		mNewpassEdt = (EditText) view.findViewById(R.id.new_pwd_edt);
		mRenewPassEdt = (EditText) view.findViewById(R.id.re_pwd_edt);
		mErrorText = (TextView) view.findViewById(R.id.error_tv);

		view.findViewById(R.id.login_button).setOnClickListener(mNewPassListener);
		dialog.setContentView(view);

		return dialog;
	}

	View.OnClickListener mNewPassListener = new View.OnClickListener() {

		@Override
		public void onClick(View v) {
			setNewPass();
		}
	};
	
	private void setNewPass() {
		
	}
	
	private boolean validate() {
		return true;
	}
	
	private void implementSetNewPass() {
		
	}

}
